<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>[|.pageTitle|]</title>
    [|if .zTree|]
    <link rel="stylesheet" href="/static/zTree3/css/demo.css?t=5" type="text/css">
    <link rel="stylesheet" href="/static/zTree3/css/zTreeStyle/zTreeStyle.css" type="text/css">
    [|end|]
    <meta charset="utf-8">
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/main.css">
    <script src="/static/layui/layui.js?s=36"></script>
    <script src="/static/js/main.js?s=2124"></script>
    <script src="/static/js/echarts.js"></script>
</head>
<body>
<div class="layui-layout layui-layout-admin" style="margin-top: 20px;">
    <form class="layui-form"  style="padding-left:40px;">
        <div class="layui-inline  layui-form-item">
            <div class="layui-input-inline" style="text-align: left;">
                <select name="usercondition" id = "usercondition" lay-verify="required" lay-search="" readonly>
                    <option value="0">玩家推广号</option>
                    <option value="1">玩家登录名</option>
                    <option value="2">玩家昵称</option>
                    <option value="3">玩家UserID</option>
                </select>
            </div>
            <div class="layui-input-inline"  style="width:140px;">
                <input type="text" class="layui-input" id="userconditioninfo">
            </div>
            <label class="layui-form-label">时间：</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="befordate" placeholder="yyyy-MM-dd" readonly>
            </div>
            <div class="layui-form-mid layui-word-aux">-</div>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="afterdate" placeholder="yyyy-MM-dd" readonly>
            </div>

            <div class="layui-btn-group" >
                <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="starquery">开始查询</button>
            </div>
        </div> 
        <br />
        <hr class="layui-bg-gray">
        <div>
            <p>
                <label id="" style="color:rgb(0, 0, 0);">赠送总金币：</label>
                <label id="cursendcount0" style="color:red;">0</label>
                <label id="" style="color:rgb(0, 0, 0);">,赠送笔数：</label>
                <label id="cursendcount1" style="color:red;">0</label>
                <label id="" style="color:rgb(0, 0, 0);">,赠送顺差：</label>
                <label id="cursendcount2" style="color:red;">0</label>
                <label id="" style="color:rgb(0, 0, 0);">,赠收比：</label>
                <label id="cursendcount3" style="color:red;">0</label>
            </p>
        </div>

    </form>

    <table  class="layui-table" id="extermervipusrs" lay-size="sm" lay-filter="layfilterextermervipusrs"> </table> 

</div>
<script>
    var $;

    layui.config({
            base : "js/"
    }).use(['form','element','layer','jquery','table','laydate'], function(){
        var table = layui.table;
        var element = layui.element;
        var form = layui.form;
        var laydate = layui.laydate;
        $ = layui.jquery;
    //监听表格复选框选择
   // table.on('checkbox(demo)', function(obj){
    //   console.log(obj);
   // });

    //监听工具条
      laydate.render({
        elem: '#befordate'
      });
    laydate.render({
        elem: '#afterdate'
      });
 
    ShowTablesDatas(table);
    form.on('submit(starquery)', function(data) {
        
        ShowTablesDatas(table);
        
        return false;
    });
   
    return false;
}); 

function ShowTablesDatas(thisTabble){
 
    var dusercondition =  document.getElementById("usercondition");
    var duserconditioninfo = document.getElementById("userconditioninfo");
    var dbefordate =  document.getElementById("befordate");
    var dafterdate =  document.getElementById("afterdate");

    thisTabble.render({
        elem:'#extermervipusrs'
        ,url:'/extremevipmanage/givesendgitflisttable'
       ,where: {
                d_usercondition: dusercondition.value
                ,d_usercondition_info: duserconditioninfo.value
                ,d_befor_date:dbefordate.value
               ,d_dafter_date: dafterdate.value
         }
        ,done: function(res, curr, count) {
            GetPageTitleData(res.titleinfo)
        }
        ,cols: [[ //标题栏
            {field:'UserID',title:'推广号',width:120}
            ,{field:'UserNickName',title:'昵称',width:170}
            ,{field:'Platform',title:'代理平台',width:120}
            ,{field:'WriteTime',title:'添加时间',width:160}
            ,{field:'SendGiftA',title:'赠送礼物A',width:150}
            ,{field:'GiveGiftB',title:'接收礼物B',width:150}
            ,{field:'Conut',title:'笔数',width:150}
            ,{field:'UserConut',title:'人数',width:150}
            ,{field:'dataTmp',title:'赠送顺差A-B',width:180}
                ]] 
        ,skin: 'row' //表格风格
        ,even: true
        ,page: true //是否显示分页
        ,limits: [50,100,200]
        ,limit: 100//每页默认显示的数量
        ,width: 'full-10'
        ,rules: 'all'
        ,height: 'full-195'
    });
}

function GetPageTitleData(titleinfo){
   // alert(JSON.stringify(titleinfo))
   // if (titleinfo.length > 0)
    {
        var dusercondition0 =  document.getElementById("cursendcount0");
        dusercondition0.innerHTML= titleinfo.AllSellScore;             
        var dusercondition1 =  document.getElementById("cursendcount1");
        dusercondition1.innerHTML=titleinfo.AllSellCount;                
        var dusercondition2 =  document.getElementById("cursendcount2");
        dusercondition2.innerHTML=titleinfo.AllZSSC;
        var dusercondition3 =  document.getElementById("cursendcount3");
        dusercondition3.innerHTML=titleinfo.ZHB;   
    }
  
    return false;
 
}

</script>
</body>
</html>